import http from '../utils/axios';  //引进http

const baseUrl = 'http://dsq.ljc.icu:8083'


interface AddRoles{
    menuIds: number[],
    roleJob: string,
    roleName: string,
    roleState?: number,
    roleId?:number
}

interface updataState{
    roleId: Number,
    state: number,
}

interface getMember{
    keys: string | undefined,
    roleName: string | undefined,
}

interface addEmpl{
    emplId?:number,
    emplMail: number[],
    emplName: string,
    emplNote: string,
    emplPhone: string,
    emplPwd:string,
    roleName:string
    emplNumber:string
}

export const getRoles = ()=>{
    return http.get<any>(baseUrl+'/permission/getRoles')
} 

export const getRoleNames = ()=>{
    return http.get<any>(baseUrl+'/permission/getRoleNames')
} 

export const AddUpdataRoles = (data:AddRoles)=>{
    return http.post<any>(baseUrl+'/permission/addOrUpdateRole',data)
} 

export const delRoles = (data:Number[])=>{
    return http.post<any>(baseUrl+'/permission/delRoles',data)
} 

export const updataState = (data:updataState)=>{
    return http.post<any>(baseUrl+'/permission/updateState',data)
} 

export const getMember = (data:getMember)=>{
    return http.post<any>(baseUrl+'/permission/getMember',data)
} 

export const delEmpls = (data:Number[])=>{
    return http.post<any>(baseUrl+'/permission/delEmpls',data)
}

export const addEmpl = (data:addEmpl)=>{
    return http.post<any>(baseUrl+'/permission/addEmpl',data)
} 